import java.util.Scanner;

public class chapter01 {
    public static void main(String[] args) {
        Scanner inpute = new Scanner(System.in);
        System.out.println("请输入购买金额：");
        int num = inpute.nextInt();
        int sum=num;
        if(num>50)
                System.out.println("1.加1元换购500ml可口可乐");
        if(num>100){
                System.out.println("2.加2元换购1000ml果汁");
                System.out.println("3.加4元换购炫迈口香糖一瓶");
            }
        if(num>200){
                System.out.println("4.加15元换购洗衣服一袋");
                System.out.println("5.加38元换购进口红酒一瓶");
            }
        for(;;){
            System.out.println("是否进行换购？y/n");
            String a = inpute.next();
            if(a.equals("n")) {
                System.out.println("欢迎下次光临");
                break;
            }else{
                System.out.println("请输入换购金额：");
                int i = inpute.nextInt();
                switch (i){
                    case 1:
                    System.out.println("换购500ml可口可乐");
                    break;
                    case 2:
                    System.out.println("换购1000ml果汁");
                    break;
                    case 4:
                    System.out.println("换购炫迈口香糖一瓶");
                    break;
                    case 15:
                    System.out.println("换购洗衣服一袋");
                    break;
                    case 38:
                    System.out.println("换购进口红酒一瓶");
                    break;
                }
                 sum = sum + i;
            }
        }
        System.out.println("实际支付的金额为"+sum);
    }
}
